x86emul: CMPXCHG{8,16}B ignore prefixes
authorJan Beulich <jbeulich@suse.com>
Wed, 14 Dec 2016 09:08:22 +0000 (10:08 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 14 Dec 2016 09:08:22 +0000 (10:08 +0100)
commit54abe826c8297e12f805be2bcf318ef75cc7f58d
tree7161afaeeabf910d173ffb51f8b03a5c8dc099a4
parent6cf995f1f59240532e27cb788a390185f4276d6f
x86emul: CMPXCHG{8,16}B ignore prefixes

This removes 0F C7 from the list of two-byte opcodes treating prefixes
66, F3, and F2 as opcode extensions. We better manually handle this in
the opcode specific code:
- CMPXCHG8B ignores all these prefixes (its handling is being adjusted
  accordingly, with a respective test case added as well, to avoid
  re-introducing the subject of XSA-200),
- RDRAND/RDSEED (support to be added subsequently) honor 66, but treat
  F3 and F2 as opcode extensions (resolving to RDPID in the RDSEED
  case, which in turn ignores 66).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/tests/x86_emulator/test_x86_emulator.c
xen/arch/x86/x86_emulate/x86_emulate.c